<?php

namespace App\Admin\Model;

use App\Admin\Model \{
    Duanzu,
        InvitationCeremony,
        Rebate,
        City,
        UnderlineCtype
};

class OrderCoupon extends Duanzu
{
    //order_coupon
        //表名
    protected $table = 'order_coupon';
    //主键
    protected $primaryKey = 'id';

    public function users()
    {
        return $this->hasOne(Users::class, 'uid', 'uid');
    }

    public function user_name()
    {
        return $this->hasOne(Users::class, 'invite_code', 'invite_code');
    }

    public function city_name()
    {
        return $this->hasOne(City::class, 'id', 'city');
    }

    public function underline_ctype()
    {
        return $this->hasOne(UnderlineCtype::class, 'id', 'ctype');
    }
}
